Skip to content

Conversation

@zharinov
Copy link
Member

@zharinov zharinov commented Jan 4, 2026

Summary

  • Zero-capture tagged variants now use Void type instead of empty struct
  • JSON output omits $data field for void variants: {"$tag":"Empty"}
  • TypeScript types omit $data field: interface QEmpty { $tag: "Empty" }

Before/After

// Before
{"$tag":"Empty","$data":{}}
interface QEmpty { $tag: "Empty"; $data: {} }

// After  
{"$tag":"Empty"}
interface QEmpty { $tag: "Empty" }

Changes

  • infer.rs: Use TYPE_VOID for zero-capture variants
  • value.rs: Make Tagged.data optional, skip serialization when None
  • materializer.rs: Track payload type, produce None for Void
  • typescript.rs: Omit $data field for Void variants
  • type-system.md: Updated documentation

@zharinov zharinov merged commit d9ba7d9 into master Jan 4, 2026
4 checks passed
@zharinov zharinov deleted the fix/void-enum-variants branch January 4, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants